import proFetch from "../../../../../../public/functions/project-fetch";
import {promptBox} from 'nc-lightapp-front';

export default function initBlacklistData() {
    const {orgVal, table} = this.props;
    const checkedRows = table.getCheckedRows('info');
    const selectedPsn = checkedRows.map(row=>row.data.values.pk_psnjob.value).join()
    let postData = {
        pk_psnjob: selectedPsn,
        pk_org: orgVal.refpk
    };

    return proFetch({
        url: '/nccloud/hrtrn/dimissionrds/DimissionRdsAddBlackListCheckAction.do',
        body: postData,
    })
        .then((res) => {
            if (res.success) {
                this.props.updateState({
                    blacklistModalVisible: true
                });
            }
        });
}
